package com.qing.design.patterns.chain_of_responsibility.example.middleware;

/**
 * 检测用户角色
 */
public class RoleCheckMiddleware extends  Middleware{
	@Override
	public boolean check(String email, String password) {
		if(email.equals("qing@126.com")){
			System.out.println("Hello admin!");
			return  true;
		}
		System.out.println("Hello user!");
		return checkNext(email, password);
	}
}
